/*
 * @Author: 黑白灰01 3193273703@qq.com
 * @Date: 2025-01-27 10:13:39
 * @LastEditors: 黑白灰01 3193273703@qq.com
 * @LastEditTime: 2025-02-13 23:01:36
 * @FilePath: /hei_picture_web/src/router/index.ts
 * @Description: 路由配置
 * */
import { createRouter, createWebHistory } from 'vue-router'
import LoginPage from '@/page/login/LoginIndex.vue'
import BaseLayout from '@/components/common/BaseLayout/LayoutIndex.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component: LoginPage,
    },
    {
      path: '/',
      name: 'layout',
      component: BaseLayout,
      children: [
        {
          path: '/',
          name: 'home',
          component: () => import('@/page/home/HomeIndex.vue'),
        },
        {
          path: '/picture_add',
          name: 'picture_add',
          component: () => import('@/page/picture/_add/AddPic.vue'),
        },
        {
          path: '/picture_info/:id',
          name: 'picture_info',
          component: () => import('@/page/picture/_info/InfoIndex.vue'),
          props: true,
        },
        {
          path: '/space',
          name: 'space',
          component: () => import('@/page/space/_info/spaceIndex.vue'),
          children: [
            {
              path: ':id/:type',
              name: 'space_info',
              component: () => import('@/page/space/_info/modal/SpaceInfo.vue'),
              props: true,
            },
          ],
        },
        {
          path: '/space_add',
          name: 'space_add',
          component: () => import('@/page/space/_add/addSpaceIndex.vue'),
        },
        {
          path: '/user_info',
          name: 'user_info',
          component: () => import('@/page/user/userInfoIndex.vue'),
        },
        {
          path: '/search_picture',
          name: 'search_picture',
          component: () => import('@/page/picture/_search/SeaPicIndex.vue'),
        },
      ],
    },
  ],
})

export default router
